<?php

/**
 * @name 订单
 */
class Controller_Order extends \Modules\Admin\Controllers\Controller {

    /**
     * @name 商品列表
     */
    public function indexAction() {

    }
    /**
     * @name 搜索商品列表
     */
    public function searchAction() {
        $param = [];
        if($this->getParams('uid')){
            $param['uid'] = $this->getParams('uid');
        }

        $obj = new \Data\Order\Order();
        $ret = $obj->getDataTable($param,[],['oid'=>'desc']);

        if($ret['data']){
            $user_obj = new \Data\User\User();
            foreach ($ret['data'] as $key=>$value){
                $user_info = $user_obj->getUserInfoById($value['uid']);
                $ret['data'][$key]['user_name'] = $user_info['name'];
            }
        }

        $this->response = $ret;
    }


}
